<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ng-value 在表单中以表达式展现</title>
    <script src="../angular.js"></script>
</head>
<body>
    <div ng-app="goods" ng-controller="ctrl">
        商品： <input type="text" name="name" ng-model="goods.name" readonly/><br />
        价格: <input type="text" name="price" ng-model="goods.price" readonly/><br />
        数量：<input type="num" name="num" ng-model="goods.num"/><br />
        总计： <input type="text" name="zongji" ng-value="goods.price * goods.num" readonly/>
    </div>

    <script>
        var mod = angular.module('goods', []);
        mod.controller('ctrl', ['$scope', function($scope){
            $scope.goods = {'name': '小米6', 'price' : 2499, 'num' :　2}
        }])
    </script>
</body>
</html>